﻿@{
    ViewBag.Title = "InfoPlaylist";
    Layout = "~/Views/Shared/_LayoutPublic.cshtml";
    List<ListenMusic.Playlist_ServiceReference.Playlist> lst_playlist = ViewBag.playlist;
}
<link href="../../Styles/Playlist/UserPlaylist.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/Confirm%20popup/jquery_facebook.alert.js" type="text/javascript"></script>
<link href="../../Styles/Confirm%20Popup/facebook.alert.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
    $(document).ready(function () {
        $(".remove").click(function (event) {
            var lstid = jQuery(this).attr("id");
            var str = lstid.split("-");
            var param = { plid: str[0] };
            jConfirm('Xác Nhận Xoá Bài Hát Này?', 'Xác Nhận',
			    function (r) {
			        if (r == true) {
			            $.post("/Info/removeplaylist", param, function (data) {
			                if (data == true) {
			                    $("#box-" + str[1]).fadeOut(300);
			                }
			            });
			        }
			    });

        });
    });
</script>
<div id="playlist-content">
    <div id="playlist">
    <form id="infoplaylist" action="">
        <fieldset id="fs-item" style="border: 1px solid silver">
            <legend><h3>Danh Sách Playlist (@lst_playlist.Count())</h3></legend>
            <div id="playlist-item"></div>             
           <ul>
            @foreach (ListenMusic.Playlist_ServiceReference.Playlist pl in lst_playlist)
            {                
                    <li>
                        Tên Playlist: <a href="/info/listen?plid=@pl.PlaylistID"> <strong>@pl.PlaylistName</strong></a>
                    </li>
	                <li>
                        <div>Ngày Tạo: @Convert.ToDateTime(pl.DateCreate).ToShortDateString()</div>
                        <div>Số bài hát: </div>
                     </li> 
                    <li>   
                        <a href="/info/editplaylist?plid=@pl.PlaylistID" class="firstbtn"><img src="../../Images/pencil.png" width=20 height=20 alt="Sửa" title="Sửa" /></a>
                        <a href="#" id="@pl.PlaylistID-@pl.PlaylistID" class="remove"><img src="../../Images/delete.png" width=20 height=20 alt="Xoá" title="Xoá" /></a>
                    </li>                 
                <hr />
            } 
            </ul>
        </fieldset>
           
</form>
</div>
</div>


